Integrand size = 29, antiderivative size = 49 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {x}{a}+\frac {\text {arctanh}(\cos (c+d x))}{a d}-\frac {\cos (c+d x)}{a d}-\frac {\cot (c+d x)}{a d} \]
Time = 1.03 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.90 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\left (1+\cot \left (\frac {1}{2} (c+d x)\right )\right )^2 \left (\cos (c+d x)+\left (c+d x+\cos (c+d x)-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{2 a d (1+\sin (c+d x))} \]
-1/2*((1 + Cot[(c + d*x)/2])^2*(Cos[c + d*x] + (c + d*x + Cos[c + d*x] - L og[Cos[(c + d*x)/2]] + Log[Sin[(c + d*x)/2]])*Sin[c + d*x])*Tan[(c + d*x)/ 2])/(a*d*(1 + Sin[c + d*x]))
Time = 0.37 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.88, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.310, Rules used = {3042, 3318, 3042, 25, 3072, 262, 219, 3954, 24}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a \sin (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (c+d x)^4}{\sin (c+d x)^2 (a \sin (c+d x)+a)}dx\) |
\(\Big \downarrow \) 3318 |
\(\displaystyle \frac {\int \cot ^2(c+d x)dx}{a}-\frac {\int \cos (c+d x) \cot (c+d x)dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx}{a}-\frac {\int -\sin \left (c+d x+\frac {\pi }{2}\right ) \tan \left (c+d x+\frac {\pi }{2}\right )dx}{a}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx}{a}+\frac {\int \sin \left (\frac {1}{2} (2 c+\pi )+d x\right ) \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx}{a}\) |
\(\Big \downarrow \) 3072 |
\(\displaystyle \frac {\int \frac {\cos ^2(c+d x)}{1-\cos ^2(c+d x)}d\cos (c+d x)}{a d}+\frac {\int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx}{a}\) |
\(\Big \downarrow \) 262 |
\(\displaystyle \frac {\int \frac {1}{1-\cos ^2(c+d x)}d\cos (c+d x)-\cos (c+d x)}{a d}+\frac {\int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx}{a}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\int \tan \left (c+d x+\frac {\pi }{2}\right )^2dx}{a}+\frac {\text {arctanh}(\cos (c+d x))-\cos (c+d x)}{a d}\) |
\(\Big \downarrow \) 3954 |
\(\displaystyle \frac {-\int 1dx-\frac {\cot (c+d x)}{d}}{a}+\frac {\text {arctanh}(\cos (c+d x))-\cos (c+d x)}{a d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {\text {arctanh}(\cos (c+d x))-\cos (c+d x)}{a d}+\frac {-\frac {\cot (c+d x)}{d}-x}{a}\) |
3.5.14.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) ^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ (b*(m + 2*p + 1))) Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b , c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c , 2, m, p, x]
Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_ Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f Subst[Int[ (ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)], x ]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]
Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^( n_.))/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[g^2/a Int [(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Simp[g^2/(b*d) Int [(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0]
Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d *x])^(n - 1)/(d*(n - 1))), x] - Simp[b^2 Int[(b*Tan[c + d*x])^(n - 2), x] , x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]
Time = 0.26 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.35
method | result | size |
parallelrisch | \(\frac {-2 d x +2-2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 \cos \left (d x +c \right )+2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}\) | \(66\) |
derivativedivides | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {4}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}-4 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d a}\) | \(73\) |
default | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {4}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}-4 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d a}\) | \(73\) |
risch | \(-\frac {x}{a}-\frac {{\mathrm e}^{i \left (d x +c \right )}}{2 a d}-\frac {{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}-\frac {2 i}{a d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d a}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d a}\) | \(103\) |
norman | \(\frac {-\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}-\frac {3 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {1}{2 a d}+\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}-\frac {x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}-\frac {x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {7 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d a}-\frac {5 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}\) | \(262\) |
1/2*(-2*d*x+2-2*ln(tan(1/2*d*x+1/2*c))-2*cos(d*x+c)+2*tan(1/2*d*x+1/2*c)-s ec(1/2*d*x+1/2*c)*csc(1/2*d*x+1/2*c))/d/a
Time = 0.27 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.63 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {2 \, {\left (d x + \cos \left (d x + c\right )\right )} \sin \left (d x + c\right ) - \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 2 \, \cos \left (d x + c\right )}{2 \, a d \sin \left (d x + c\right )} \]
-1/2*(2*(d*x + cos(d*x + c))*sin(d*x + c) - log(1/2*cos(d*x + c) + 1/2)*si n(d*x + c) + log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 2*cos(d*x + c))/( a*d*sin(d*x + c))
\[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\int \frac {\cos ^{4}{\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]
Leaf count of result is larger than twice the leaf count of optimal. 154 vs. \(2 (49) = 98\).
Time = 0.31 (sec) , antiderivative size = 154, normalized size of antiderivative = 3.14 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {\frac {4 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + 1}{\frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {a \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}} + \frac {4 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {2 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{2 \, d} \]
-1/2*((4*sin(d*x + c)/(cos(d*x + c) + 1) + sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + 1)/(a*sin(d*x + c)/(cos(d*x + c) + 1) + a*sin(d*x + c)^3/(cos(d*x + c) + 1)^3) + 4*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a + 2*log(sin(d*x + c)/(cos(d*x + c) + 1))/a - sin(d*x + c)/(a*(cos(d*x + c) + 1)))/d
Leaf count of result is larger than twice the leaf count of optimal. 113 vs. \(2 (49) = 98\).
Time = 0.34 (sec) , antiderivative size = 113, normalized size of antiderivative = 2.31 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {6 \, {\left (d x + c\right )}}{a} + \frac {6 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} - \frac {3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 10 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} a}}{6 \, d} \]
-1/6*(6*(d*x + c)/a + 6*log(abs(tan(1/2*d*x + 1/2*c)))/a - 3*tan(1/2*d*x + 1/2*c)/a - (2*tan(1/2*d*x + 1/2*c)^3 - 3*tan(1/2*d*x + 1/2*c)^2 - 10*tan( 1/2*d*x + 1/2*c) - 3)/((tan(1/2*d*x + 1/2*c)^3 + tan(1/2*d*x + 1/2*c))*a)) /d
Time = 10.04 (sec) , antiderivative size = 147, normalized size of antiderivative = 3.00 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {2\,\mathrm {atan}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-4}+\frac {4}{4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-4}\right )}{a\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1}{d\,\left (2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a\,d} \]